﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace foldshot.View
{
    [Obsolete] //TODO: remove it
    public partial class OpenTwoFilesDialog : Form
    {

        public FileInfo File1;
        public FileInfo File2;

        public OpenTwoFilesDialog()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (this.openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                File1 = new FileInfo(this.openFileDialog1.FileName);
                this.textBox1.Text = File1.Name;
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (this.openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                File2 = new FileInfo(this.openFileDialog1.FileName);
                this.textBox2.Text = File2.Name;
            }
        }

        private void button4_Click(object sender, EventArgs e)
        {
            this.DialogResult = System.Windows.Forms.DialogResult.Cancel;            
        }

        private void button3_Click(object sender, EventArgs e)
        {
            if (File1 == null || !File1.Exists)
            {
                MessageBox.Show("File1 can not be read", "Error", MessageBoxButtons.OK);
                return;
            }
            if (File2 == null || !File2.Exists)
            {
                MessageBox.Show("File2 can not be read", "Error", MessageBoxButtons.OK);
                return;
            }

            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            
        }
    }
}
